<!DOCTYPE html >
<html>
<head>
    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />

    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.line.js" ></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->
    
    <title>A Line chart with the X axis in the middle</title>
    
    <meta name="robots" content="noindex,nofollow" />
    <meta name="description" content="A Line chart that shows the various axis options that you can manipulate" />
     
</head>
<body>

    <h1>A Line chart demonstrating  the axis options</h1>

    <button onclick="obj = getObject(); obj.Set('xaxispos', obj.Get('xaxispos') == 'bottom' ? 'center' : 'bottom'); RGraph.Redraw();">Toggle the X axis position</button>
    <button onclick="obj = getObject(); obj.Set('yaxispos', obj.Get('yaxispos') == 'left' ? 'right' : 'left'); RGraph.Redraw();">Toggle the Y axis position</button>
    <button onclick="obj = getObject(); obj.Set('ylabels', obj.Get('ylabels') ? false : true); RGraph.Redraw();">Toggle the Y axis labels</button>
    <button onclick="obj = getObject(); obj.Set('ylabels.specific', obj.Get('ylabels.specific') ? null : ['High','Medium','Low']); RGraph.Redraw();">Toggle specific Y axis labels</button>
    <button onclick="obj = getObject(); obj.Set('ymin', obj.Get('ymin') ? 0 : 50); RGraph.Redraw();">Toggle ymin (50) setting</button>
    <button onclick="obj = getObject(); obj.Set('noxaxis', obj.Get('noxaxis') ? false : true); RGraph.Redraw();">Toggle X axis </button>
    <button onclick="obj = getObject(); obj.Set('labels', obj.Get('labels') ? null : ['Q1','Q2','Q3','Q4']); RGraph.Redraw();">Toggle X labels</button>
    
    <br />

    <canvas id="cvs" width="600" height="400">[No canvas support]</canvas>
    
    <script>
        function getObject ()
        {
            return RGraph.ObjectRegistry.getFirstObjectByType('line');
        }

        $(document).ready(function ()
        {
            var line = new RGraph.Line({
                id: 'cvs',
                data: [65,70,74,64,58,94,75,64,68,78],
                options: {
                    ymax: 100,
                    xmax: 365,
                    labels: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
                    xaxispos: 'center',
                    gutter: {
                        bottom: 45
                    }
                }
            }).draw();
        })
    </script>

    <p>        
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>